<template>
  <swiper
    :options="swiperOption"
    class="swiper"
  >
    <!-- slides -->
    <swiper-slide
      v-for="(item,index) of list"
      :key="index"
    >{{item.text}}</swiper-slide>
    <!-- Optional controls -->
    <div
      class="swiper-pagination"
      slot="pagination"
    ></div>
  </swiper>
</template>

<script>
export default {
  name: "HomeSwiper",
  data() {
    return {
      swiperOption: {
        pagination: ".swiper-pagination", // 添加轮播点
        // paginationClickable: true,
        loop: true, // 轮播可循环
        autoplay: 2000, // 间隔时间
        autoplayDisableOnInteraction: false
      },
      list: [
        {
          id: "0001",
          text: "1"
        },
        {
          id: "0002",
          text: "2"
        },
        {
          id: "0003",
          text: "3"
        }
      ]
    }
  }
}
</script>

<style lang="stylus" scoped>
.swiper
  overflow hidden
  width 100%
  height 0
  padding-bottom 31.25%
  background #ececec
</style>
